import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart';
import '../style/app_colors.dart';
import 'controller/CustomAppBottomBarController.dart';

class CustomAppBottomBar extends GetView<CustomAppBottomBarController> implements PreferredSizeWidget {
  VoidCallback? onPressed;
  String? content;
  CustomAppBottomBarController? mController;

  CustomAppBottomBar(this.content,{Key? key, this.onPressed}) : super(key: key);

  @override
  Size get preferredSize =>  Size.fromHeight(72.h); // 定义固定高度



  @override
  Widget build(BuildContext context) {
    mController =  Get.put(CustomAppBottomBarController());
    return Obx(() => mController!.hasNetWork.value ? SizedBox(): Container(
      padding: EdgeInsets.only(top: 18.h, bottom: 13.h,left: 40.w),
      color: AppColors.warning_tip_bgColor,
      width: MediaQuery.of(context).size.width,
      child: Text(this.content! ,style: TextStyle(fontSize: 26.sp,color: Colors.red)),
    ));
  }
}